﻿package net.area80.sitemanager.popup
{
	import flash.display.MovieClip;
	import flash.events.Event;
	import gs.TweenLite;
	import net.area80.sitemanager.display.FreezeClip;
	import net.area80.sitemanager.page.AbstractPage;
	
	/**
	* AbstractPopup
	* @author Wissarut Pimanmassuriya
	*/
	public class AbstractPopup extends AbstractPage
	{
		protected var freezeClip:FreezeClip;
		
		public function AbstractPopup ():void {
			addEventListener(Event.ADDED_TO_STAGE, onAdded, false, 0, true);
			addEventListener(Event.REMOVED_FROM_STAGE, onRemoved, false, 0, true);
			super();
		}

		protected function onAdded (e:Event):void {
			createFreezeClip();
		}
		protected function onRemoved (e:Event):void {
			if(contains(freezeClip)) removeChild(freezeClip);
		}
		protected function createFreezeClip ():void {
				
				freezeClip = new FreezeClip();
				addChildAt(freezeClip, 0);
				
		}
	}
	
}